package com.ihr360.payroll.dao;

import com.ihr360.payroll.model.dto.salary.profile.CompanySalaryProfile;
import com.ihr360.rest.reposity.SimpleRestReposity;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

import java.util.List;

@RepositoryRestResource
public interface CompanySalaryProfileRepository extends SimpleRestReposity<CompanySalaryProfile,Long> {

    //注意：这里不允许直接调用该方法获取公司薪资档案，如果需要请调用CompanySalaryProfileService#getOrCreateByCompanyId方法
    CompanySalaryProfile findByCompanyId(String companyId);

    @Query(value = " select companyId from CompanySalaryProfile group by companyId  ")
    List<String> getAllExitCompanyIds();
}
